package com.uek.utils;

public class ResultData<T> extends Result{
    private T data;

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public static <T> ResultData<T> success(T data){
        ResultData<T> resultData=new ResultData<>();
        resultData.setCode(ApiCode.SUCCESS.getCode());
        resultData.setMessage(ApiCode.SUCCESS.getMsg());
        resultData.setData(data);
        return resultData;
    }

    public static <T> ResultData<T> success(int code,String message, T data){
        ResultData<T> resultData=new ResultData<>();
        resultData.setCode(code);
        resultData.setMessage(message);
        resultData.setData(data);
        return resultData;
    }



}
